ymd

Brightcells 5 anos atrás
pai
commit
60f092b6c0
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      page/sale_views.py

+ 4 - 4
page/sale_views.py

@@ -168,6 +168,8 @@ def clerk_sale_decrypt_api(request):
168 168
     except ValueError:
169 169
         return response(ProductDistributorStatusCode.DISTRIBUTOR_NOT_FOUND)
170 170
 
171
+    ymd = tc.local_string(format='%Y%m%d')
172
+
171 173
     # 店员提交记录
172 174
     ssli = SaleclerkSubmitLogInfo.objects.create(
173 175
         brand_pk=brand.pk,
@@ -186,8 +188,8 @@ def clerk_sale_decrypt_api(request):
186 188
         image=file_path,
187 189
         test_user=clerk.test_user,
188 190
         test_sn=test_sn,
189
-        ym=tc.local_string(format='%Y%m'),
190
-        ymd=tc.local_string(format='%Y%m%d'),
191
+        ym=ymd[:6],
192
+        ymd=ymd,
191 193
     )
192 194
 
193 195
     if settings.CHECK_TESTSN_ENABLED and test_sn:
@@ -255,8 +257,6 @@ def clerk_sale_decrypt_api(request):
255 257
 
256 258
     # TODO: Make statistic async
257 259
     if (not settings.CHECK_DUPLOAD_ENABLED) or (not clerk.test_user and not sci):
258
-        ymd = tc.local_string(format='%Y%m%d')
259
-
260 260
         # 日销量统计
261 261
         ssi, _ = SaleStatisticInfo.objects.select_for_update().get_or_create(
262 262
             brand_id=brand.brand_id,